interface User {
    name: string;
    age: number;
    gender: string;
    address: string;
  }
   
  type UserNameAndAddress = Pick<User, 'name' | 'address'>;
   
  const userNameAndAddress: UserNameAndAddress = {
    name: 'John',
    address: 'New York' // 只包含name和address属性
  };

  interface User {
    name: string;
    age: number;
    gender: string;
    address: string;
  }
   
  type omit = Omit<User, 'name' | 'gender'>;
   
  const res: omit = {
    age: 18,
    address:" 互补"
  };



//   type Cate = {
//     id:number,
//     name:string
//   }
//   const cate:Cate ={
//     id:10086,
//     name:'cate'
//   }

//   cate.id = 10086,
//   cate.name = 'cate'

type Res = {
    id:number,
    name:string
}

type Cate = Partial<Res>
const cate:Cate = {
  
};


cate.id = 10086;
cate.name = 'newCateName';